package app.stock.client;

import javax.swing.JScrollPane;
import javax.swing.JTable;

public class DataTableScrollPane extends JScrollPane {
    private JTable rowHeaderTable;

    public DataTableScrollPane() {
        super();
    }

    public void initialize() {
        DataTable dataTable = (DataTable) this.getViewport().getComponents()[0];
        System.out.println(dataTable);
        System.out.println(dataTable.getRowCount());
        System.out.println(dataTable.tableData.length);
        int rowCount = dataTable.getModel().getRowCount();
        rowHeaderTable = new JTable(rowCount, 1);
        rowHeaderTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
        for (int i = 0; i < rowCount; i++) {
            this.rowHeaderTable.setValueAt(i, i, 0);
        }
        this.setRowHeaderView(rowHeaderTable);
    }
} // @jve:decl-index=0:visual-constraint="28,-3"
